import { Message } from "element-ui";
export default function ({ $axios, redirect, $store }) {
    $axios.onError(err => {
        const { statusCode, message } = err.response.data;

        // 还未使用
        if (statusCode === 401 || statusCode === 403) {
            Message.warning({ message: "请先登录" });
            // $store.commit("user/setUserInfo", {});
            // redirect("/user");
        }

        if (statusCode === 400) {
            Message.warning({ message });
        }
    })
}